Skip to content

improvement(deployments): bugfixes for run-block, airtable + external sub management#5680

Merged
icecrasher321 merged 16 commits into
stagingfrom
improvement/deployment-bugs
Jul 16, 2026
Merged

improvement(deployments): bugfixes for run-block, airtable + external sub management#5680
icecrasher321 merged 16 commits into
stagingfrom
improvement/deployment-bugs

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Make deployment status truthful end-to-end: deployments now move through an explicit state machine (preparing → activating → active / failed / superseded) backed by an outbox with inline-first execution, so a version is only reported live once its webhooks, schedules, and external subscriptions actually exist. Webhook registration is rebuilt on stable, generation-fenced rows with create-before-delete cutover — a failed deploy can no longer take down the currently live version, leave ghost registrations that wedge future deploys, or silently swallow provider errors (now surfaced in the deploy modal, versions list, and API responses).

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 16, 2026 12:29am

Request Review

…ment-bugs

# Conflicts:
#	apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx
@icecrasher321 icecrasher321 marked this pull request as ready for review July 15, 2026 00:22
@cursor

cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches deployment orchestration, execution ingress (webhooks/schedules/MCP), and fork rollback cutover—incorrect gating could block deploys or run wrong workflow versions.

Overview
Deployment APIs, MCP, chat updates, and the deploy modal now treat live as an active version snapshot with activeDeployment / latestDeploymentAttempt (preparing, activating, active, failed)—not the legacy workflow.isDeployed flag. Deploy and promote responses expose attempt state; chat PATCH skips redundant redeploys, returns 409 while an attempt is in flight, and only persists after cutover is active.

MCP and workflow execute pin runs to the admitted deploymentVersionId; background webhook and schedule jobs honor that version, skip undeployed workflows, and tighten schedule claims with deploymentOperationId. Webhook cron/target queries use deliverableWebhookPredicate. Fork rollback drives reactivation through the deployment outbox, reports pendingActivations, and keeps the undo point until activations settle.

Also adds grain_v2 (event-type webhooks, new triggers, AI action items), extends Airtable typecast to all write ops, and normalizes else branch handling via isElseConditionTitle in the editor and executor.

Reviewed by Cursor Bugbot for commit 11bb86d. Configure here.

Comment thread apps/sim/app/api/workflows/[id]/deploy/route.ts Outdated
Comment thread apps/sim/background/webhook-execution.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/app/api/chat/manage/[id]/route.ts
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes deployment status follow the real deployment lifecycle. The main changes are:

  • Operation-backed deploy preparation and activation.
  • Generation-fenced webhook registration and cleanup.
  • Pinned MCP execution against deployment snapshots.
  • Updated deployment API responses and UI status states.
  • Airtable typecast support for create and update tools.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/deploy.ts Adds stable webhook preparation and version-scoped cleanup for deployment operations.
apps/sim/lib/workflows/deployment-outbox.ts Adds deployment preparation, readiness checkpoints, activation, cleanup, and post-activation side effects.
apps/sim/lib/workflows/persistence/deployment-operations.ts Adds deployment operation generation, status transitions, activation guards, and superseding behavior.
apps/sim/app/api/mcp/serve/[serverId]/route.ts Pins MCP tool execution requests to the active deployment version at call time.
apps/sim/app/api/workflows/[id]/execute/route.ts Restricts deployment snapshot execution to the internal MCP bridge path.

Reviews (2): Last reviewed commit: "address comments" | Re-trigger Greptile

Comment thread apps/sim/lib/workflows/persistence/deployment-operations.ts
Comment thread apps/sim/lib/workflows/deployment-outbox.ts
Comment thread apps/sim/lib/workflows/deployment-outbox.ts
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/ee/workspace-forking/lib/promote/reactivate-in-tx.ts
Comment thread apps/sim/app/api/mcp/serve/[serverId]/route.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7ffd781. Configure here.

Comment thread apps/docs/content/docs/en/integrations/airtable.mdx
…ment-bugs

# Conflicts:
#	apps/sim/background/tiktok-webhook-targets.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

Comment thread apps/sim/app/api/chat/manage/[id]/route.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

Comment thread apps/sim/lib/workflows/orchestration/deploy.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

Comment thread apps/sim/ee/workspace-forking/lib/promote/reactivate-in-tx.ts
Comment thread apps/sim/blocks/blocks/grain.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

Comment thread apps/sim/ee/workspace-forking/lib/promote/rollback.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 11bb86d. Configure here.

@icecrasher321 icecrasher321 merged commit 54b35a4 into staging Jul 16, 2026
17 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/deployment-bugs branch July 16, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants